/*   1:    */ package org.intellij.plugins.relaxNG.compact;
/*   2:    */ 
/*   3:    */

import com.intellij.lang.ASTNode;
import com.intellij.lang.ParserDefinition;
import com.intellij.lang.ParserDefinition.SpaceRequirements;
import com.intellij.lang.PsiParser;
import com.intellij.lexer.Lexer;
import com.intellij.openapi.project.Project;
import com.intellij.psi.FileViewProvider;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.IFileElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.util.NotNullFunction;
import org.intellij.plugins.relaxNG.compact.lexer.CompactSyntaxLexerAdapter;
import org.intellij.plugins.relaxNG.compact.parser.RncParser;
import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
import org.intellij.plugins.relaxNG.compact.psi.impl.RncElementImpl;
import org.intellij.plugins.relaxNG.compact.psi.impl.RncFileImpl;
import org.jetbrains.annotations.NotNull;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */
/*  17:    */
/*  18:    */
/*  19:    */
/*  20:    */
/*  21:    */
/*  22:    */
/*  23:    */ 
/*  24:    */ public class RncParserDefinition
/*  25:    */   implements ParserDefinition
/*  26:    */ {
/*  27: 45 */   public static final IFileElementType FILE_ELEMENT_TYPE = new IFileElementType(RngCompactLanguage.INSTANCE);
/*  28: 46 */   private static final TokenSet a = TokenSet.orSet(new TokenSet[] { RncTokenTypes.COMMENTS, RncTokenTypes.DOC_TOKENS });
/*  29:    */   
/*  30:    */   @NotNull
/*  31:    */   public Lexer createLexer(Project paramProject)
/*  32:    */   {
/*  33: 50 */     void tmp7_4 = new CompactSyntaxLexerAdapter();
/*  34: 50 */     if (tmp7_4 == null) {
/*  35: 50 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncParserDefinition", "createLexer" }));
/*  36:    */     }
/*  37: 50 */     return tmp7_4;
/*  38:    */   }
/*  39:    */   
/*  40:    */   public PsiParser createParser(Project paramProject)
/*  41:    */   {
/*  42: 54 */     return new RncParser();
/*  43:    */   }
/*  44:    */   
/*  45:    */   public IFileElementType getFileNodeType()
/*  46:    */   {
/*  47: 58 */     return FILE_ELEMENT_TYPE;
/*  48:    */   }
/*  49:    */   
/*  50:    */   @NotNull
/*  51:    */   public TokenSet getWhitespaceTokens()
/*  52:    */   {
/*  53: 63 */     TokenSet tmp13_10 = TokenSet.create(new IElementType[] { TokenType.WHITE_SPACE });
/*  54: 63 */     if (tmp13_10 == null) {
/*  55: 63 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncParserDefinition", "getWhitespaceTokens" }));
/*  56:    */     }
/*  57: 63 */     return tmp13_10;
/*  58:    */   }
/*  59:    */   
/*  60:    */   @NotNull
/*  61:    */   public TokenSet getCommentTokens()
/*  62:    */   {
/*  63: 68 */     TokenSet tmp3_0 = a;
/*  64: 68 */     if (tmp3_0 == null) {
/*  65: 68 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncParserDefinition", "getCommentTokens" }));
/*  66:    */     }
/*  67: 68 */     return tmp3_0;
/*  68:    */   }
/*  69:    */   
/*  70:    */   @NotNull
/*  71:    */   public TokenSet getStringLiteralElements()
/*  72:    */   {
/*  73: 73 */     TokenSet tmp13_10 = TokenSet.create(new IElementType[] { RncTokenTypes.LITERAL });
/*  74: 73 */     if (tmp13_10 == null) {
/*  75: 73 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncParserDefinition", "getStringLiteralElements" }));
/*  76:    */     }
/*  77: 73 */     return tmp13_10;
/*  78:    */   }
/*  79:    */   
/*  80:    */   @NotNull
/*  81:    */   public PsiElement createElement(ASTNode paramASTNode)
/*  82:    */   {
/*  83: 79 */     IElementType localIElementType = paramASTNode.getElementType();
/*  84: 81 */     if ((localIElementType instanceof NotNullFunction))
/*  85:    */     {
/*  86: 82 */       PsiElement tmp27_24 = ((PsiElement)((NotNullFunction)localIElementType).fun(paramASTNode));
/*  87: 82 */       if (tmp27_24 == null) {
/*  88: 82 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncParserDefinition", "createElement" }));
/*  89:    */       }
/*  90: 82 */       return tmp27_24;
/*  91:    */     }
/*  92: 85 */     void tmp70_67 = new MyRncElement(paramASTNode);
/*  93: 85 */     if (tmp70_67 == null) {
/*  94: 85 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncParserDefinition", "createElement" }));
/*  95:    */     }
/*  96: 85 */     return tmp70_67;
/*  97:    */   }
/*  98:    */   
/*  99:    */   public PsiFile createFile(FileViewProvider paramFileViewProvider)
/* 100:    */   {
/* 101: 89 */     return new RncFileImpl(paramFileViewProvider);
/* 102:    */   }
/* 103:    */   
/* 104:    */   public ParserDefinition.SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode paramASTNode1, ASTNode paramASTNode2)
/* 105:    */   {
/* 106: 93 */     return ParserDefinition.SpaceRequirements.MAY;
/* 107:    */   }
/* 108:    */   
/* 109:    */   private static class MyRncElement
/* 110:    */     extends RncElementImpl
/* 111:    */   {
/* 112:    */     public MyRncElement(ASTNode paramASTNode)
/* 113:    */     {
/* 114: 98 */       super();
/* 115:    */     }
/* 116:    */     
/* 117:    */     public void accept(@NotNull RncElementVisitor paramRncElementVisitor)
/* 118:    */     {
/* 119:102 */       if (paramRncElementVisitor == null) {
/* 120:102 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/plugins/relaxNG/compact/RncParserDefinition$MyRncElement", "accept" }));
/* 121:    */       }
/* 122:102 */       paramRncElementVisitor.visitElement(this);
/* 123:    */     }
/* 124:    */   }
/* 125:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.compact.RncParserDefinition

 * JD-Core Version:    0.7.0.1

 */